const ws = new WebSocket("ws://localhost:8081");

ws.onmessage = ({ data }) => {
  console.log("Message from server:", data);
};

document.querySelector("button").addEventListener("click", function () {
  ws.send("hello");
});
